<?php

require_once('db/db.php');

$db=new DB;

$page=1;
$rows=10;
if(isset($_REQUEST['page'])){
	$page=$_REQUEST['page'];
}
if(isset($_REQUEST['rows'])){
	$rows=$_REQUEST['rows'];
}
$start=($page-1)*$rows;

$result=$db->get_all("select * from ad limit $start,$rows");

echo json_encode($result);

?>
